package com.zlb.app.modules.app.controller;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.zlb.app.common.entity.R;
import com.zlb.app.utils.JsonUtil;
import com.zlb.app.utils.TianUtil;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author zlb
 * @Since 2024-09-05 22:01:36
 */
@RestController
@RequestMapping("/home")
@RequiredArgsConstructor
@Api(tags = "测试接口")
public class IndexController {

    @GetMapping("/saylove")
    public R<String> saylove(){
        JSONObject jsonObject = TianUtil.get("/saylove/index", null);
        return R.ok(StrUtil.emptyToDefault(StrUtil.toStringOrNull(JsonUtil.select(jsonObject,"result.content")),"今日请求次数已耗尽,爱你"));
    }


}
